package com.minaClient.service;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.apache.log4j.Logger;

import com.alibaba.fastjson.JSON;
import com.minaClient.fileHandler.ClientSend;

/**
 * Application Lifecycle Listener implementation class StartListener
 *
 */
@WebListener
public class StartListener implements ServletContextListener {


	public static Logger log = null; 

	public StartListener() {
		// TODO Auto-generated constructor stub
		log = Logger.getLogger(StartListener.class.getName());
    	log.debug("StartListener Default constructor");
	}
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
		SessionManager.getInstance().closeSession();
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
		(new MinaService()).minaClientStart();
		log.debug("客户端已经启动");
	}
	
}
